package gov.huang.utils;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

public class RandomUtils {
    private static String XING = "赵钱孙李周吴郑王蒋沈韩苗凤花费廉岑薛方杨冯陈褚卫俞酆鲍史唐任袁柳朱秦尤雷贺倪汤许何吕施张孔曹鲁韦昌马严华金魏陶姜戚谢邹奚范彭郎喻柏水窦章云苏潘葛";
    private static String MING = "忠中二录万俊杰熔萍一衣亿易尔而泗嗣物武吾毋流柳陆浏流其齐奇启戚祁绮士海松勇永华贵真珍贞震臻甄鸿红宏成橙城程乘盛晨臣进金" +
            "津錦顺瞬舜容熔蓉绒溶隆龙拢珑凯楷恺铠娟涓节婕桀桔文雯温玟静镜净婧菁治志至智聪康糠慷小肖晓筱潇漮平品屏正瑞睿蕊锐芮家佳荚林琳淋霖鳞麟凛" +
            "熊雄如茹汝儒濡停挺婷庭亭廷汀霆锋风峰凤分芬奋新心信鑫欣芯馨锌歆忻玉雨宇羽裕钰煜军君均菌冰彬斌宾滨春雅娅烨業燕丽莉黎";


    private static List<String> XINGLIST = new ArrayList<>();
    private static List<String> MINGLIST = new ArrayList<>();

    private static Random RANDOM = new Random();
    static {
        char[] xingArray = XING.toCharArray();
        char[] mingArray = MING.toCharArray();
        for(int a=0;a<xingArray.length;a++){
            XINGLIST.add(xingArray[a]+"");
        }
        for(int a=0;a<mingArray.length;a++){
            MINGLIST.add(mingArray[a]+"");
        }
    }

    public static String randomXingMing(){
        StringBuilder xingMing = new StringBuilder();
        int xingRandIndex = RANDOM.nextInt(XING.length());
        int mingRandIndex1 = RANDOM.nextInt(MING.length());
        int mingRandIndex2 = RANDOM.nextInt(MING.length());
        xingMing.append(XINGLIST.get(xingRandIndex));
        xingMing.append(MINGLIST.get(mingRandIndex1));
        xingMing.append(MINGLIST.get(mingRandIndex2));
        return xingMing.toString();
    }

    public static String randomTel(){
        StringBuilder tel = new StringBuilder("1");
        String[] two = {"3,4,5,6,7,8,9"};
        int twoRan = RANDOM.nextInt(7);
        tel.append(two[twoRan]);
        for(int a=0;a<9;a++){
            int i = RANDOM.nextInt(10);
            tel.append(i+"");
        }
        return tel.toString();
    }

    public static void main(String[] args) {
        String xingming = RandomUtils.randomXingMing();
        System.out.println(xingming);
        String tel = RandomUtils.randomTel();
        System.out.println(tel);
    }
}
